package com.ouyeel.domain;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;

import java.io.Serializable;
import java.text.ParseException;
import java.util.Date;

/**
 * Class Name : RfqRequestBaseVo.
 * Description : 询单主表查询实体类.
 * Created by Auto on 2016-05-06.
 */
public class RfqRequestAuditVo implements Serializable {

    private static final long serialVersionUID = 1L;

	private String id;	//主键
	private String rfqMethod;	//竞价模式
	private String unifiedRfqNum;	//询价单号
	private String title;	//询单标题
	private String ouId;	//采购组织ID
	private String ouName;	//采购组织
	private String type;	//询单状态
	private String quotationEndDate;//报价截止时间
	private String isAudit;	//审批状态(创建审批)
	private String isResultAudit;	//审批状态(结果审批)
	private String isDorenAudit;    //审批状态(多伦审批)

	//关联审核记录表字段
	private String gaId;	//审批记录主键
	private String auditType;	//审批类型
	private String approvalCode;	//审批流编号
	private String signCode;	//审核记录编号
	private String objectType;	//单据类型(值集:A17)
	private String objectBillId;	//单据ID(business FK)
	private String applicantUserid;	//申请人ID
	private String applicantUsername;	//申请人名称
	private String applicantTime;	//申请时间
	private String applicationDesc;	//申请描述
	private String status;	//审批状态(值集:A19)

	private String stepId;	//对应步骤id
	private String roleIds;	//对应角色id

	private String showStatus;	//显示审批状态

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getRfqMethod() {
		return rfqMethod;
	}

	public void setRfqMethod(String rfqMethod) {
		this.rfqMethod = rfqMethod;
	}

	public String getUnifiedRfqNum() {
		return unifiedRfqNum;
	}

	public void setUnifiedRfqNum(String unifiedRfqNum) {
		this.unifiedRfqNum = unifiedRfqNum;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getOuId() {
		return ouId;
	}

	public void setOuId(String ouId) {
		this.ouId = ouId;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getQuotationEndDate(){
		String result = "";
		if(StringUtils.isNotBlank(quotationEndDate)){
			Date newDate = null;
			try {
				newDate = DateUtils.parseDate(quotationEndDate,"yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd");
			} catch (ParseException e) {
				return result;
			}
			result = DateFormatUtils.format(newDate,"yyyy-MM-dd HH:mm");
		}else {
			result = "";
		}
		return result;
	}

	public void setQuotationEndDate(String quotationEndDate) {
		this.quotationEndDate = quotationEndDate;
	}

	public String getAuditType() {
		return auditType;
	}

	public void setAuditType(String auditType) {
		this.auditType = auditType;
	}

	public String getApprovalCode() {
		return approvalCode;
	}

	public void setApprovalCode(String approvalCode) {
		this.approvalCode = approvalCode;
	}

	public String getSignCode() {
		return signCode;
	}

	public void setSignCode(String signCode) {
		this.signCode = signCode;
	}

	public String getObjectType() {
		return objectType;
	}

	public void setObjectType(String objectType) {
		this.objectType = objectType;
	}

	public String getObjectBillId() {
		return objectBillId;
	}

	public void setObjectBillId(String objectBillId) {
		this.objectBillId = objectBillId;
	}

	public String getApplicantUserid() {
		return applicantUserid;
	}

	public void setApplicantUserid(String applicantUserid) {
		this.applicantUserid = applicantUserid;
	}

	public String getApplicantUsername() {
		return applicantUsername;
	}

	public void setApplicantUsername(String applicantUsername) {
		this.applicantUsername = applicantUsername;
	}

	public String getApplicantTime() {
		String result = "";
		if(StringUtils.isNotBlank(applicantTime)){
			Date newDate = null;
			try {
				newDate = DateUtils.parseDate(applicantTime,"yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd");
			} catch (ParseException e) {
				return result;
			}
			result = DateFormatUtils.format(newDate,"yyyy-MM-dd HH:mm");
		}else {
			result = "";
		}
		return result;
	}

	public void setApplicantTime(String applicantTime) {
		this.applicantTime = applicantTime;
	}

	public String getApplicationDesc() {
		return applicationDesc;
	}

	public void setApplicationDesc(String applicationDesc) {
		this.applicationDesc = applicationDesc;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getStepId() {
		return stepId;
	}

	public void setStepId(String stepId) {
		this.stepId = stepId;
	}

	public String getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(String roleIds) {
		this.roleIds = roleIds;
	}

	public String getShowStatus() {
		return showStatus;
	}

	public void setShowStatus(String showStatus) {
		this.showStatus = showStatus;
	}

	public String getGaId() {
		return gaId;
	}

	public void setGaId(String gaId) {
		this.gaId = gaId;
	}

	public String getIsAudit() {
		return isAudit;
	}

	public void setIsAudit(String isAudit) {
		this.isAudit = isAudit;
	}

	public String getOuName() {
		return ouName;
	}

	public void setOuName(String ouName) {
		this.ouName = ouName;
	}

	public String getIsResultAudit() {
		return isResultAudit;
	}

	public void setIsResultAudit(String isResultAudit) {
		this.isResultAudit = isResultAudit;
	}

	public String getIsDorenAudit() {
		return isDorenAudit;
	}

	public void setIsDorenAudit(String isDorenAudit) {
		this.isDorenAudit = isDorenAudit;
	}
}
